<!DOCTYPE html>
<html>
<head>
    <title>产品信息</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>

    <div v-show="!showList" class="panel panel-success">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal" onsubmit="return false">
            <div class="form-group">
                <div class="col-sm-2 control-label">名称</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" :disabled="showInfo" v-model="book.name" placeholder="名称"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">类别</div>
                <div class="col-sm-10">
                    <select class="form-control" :disabled="showInfo" v-model="book.type">
                        <option v-for="l in types" :value="l.id">{{l.name}}</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">生产公司</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" :disabled="showInfo" v-model="book.chuban"
                           placeholder="生产公司"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">负责人</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" :disabled="showInfo" v-model="book.author"
                           placeholder="负责人"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">上架日期</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" :disabled="showInfo" v-model="book.time"

                           onclick="layui.laydate({elem: this, istime: true, format: 'YYYY-MM-DD hh:mm:ss', choose: function(date){vm.book.time=date;}})"
                           placeholder="上架日期"/>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label">所在位置</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" :disabled="showInfo" v-model="book.area" placeholder="所在位置"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">介绍</div>
                <div class="col-sm-10">
                    <textarea class="form-control" :disabled="showInfo" v-model="book.content" placeholder="介绍"
                              cols="30" rows="5"></textarea>
                </div>
            </div>
            <div class="form-group" v-if="showInfo">
                <div class="col-sm-2 control-label">状态</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" :disabled="showInfo" v-model="book.state" placeholder="状态"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">rfid唯一编码</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" :disabled="showInfo" v-model="book.code"
                           placeholder="rfid唯一编码"/>
                </div>
            </div>
            <div class="form-group" v-if="showInfo">
                <div class="col-sm-2 control-label">添加时间</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" :disabled="showInfo" v-model="book.gmttime"
                           placeholder="添加时间"/>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定" v-if="!showInfo"/>
            </div>
        </form>
    </div>
</div>

<script src="${rc.contextPath}/js/admin/add.js?_${date.systemTime}"></script>
</body>
</html>